package dao;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;
import po.User;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/28 15:01
 * @description:
 */
public interface UserDao {

  int userNameCount(String username);
  User findByUserNameAndPassword(@Param("username") String username, @Param("password") String password);

  List<User> findAll();


  int insert(User user);

  User findByUsername(String username);


  int resetPassword(@Param("arg1") String passwordOld,@Param("arg2") String passwordNew);

  int update_information(@Param("username") String username,@Param("email")String email, @Param("phone")String phone, @Param("question")String question, @Param("answer")String answer);


  User findAnswerByUsernameAndQuestion(@Param("username") String username, @Param("question") String question, @RequestParam("answer") String answer);

  int setPasswordByUserName(@Param("username") String username, @Param("password") String passwordNew);
}
